
<!--<once-generated>这个文件只生成一次，再次生成不会被覆盖。</once-generated>-->
<!--<last-editor>Bruce.Yu</last-editor>-->
<nz-card>
  <div>
    <button nz-button (click)="loadTreeData()"><i nz-icon nzType="reload" nzTheme="outline"></i>刷新</button>
    <button nz-button (click)="createSibling()" acl="Root.Admin.LMS.Organization.Create"><i nz-icon type="plus" theme="outline"></i>新增同级</button>
    <button nz-button (click)="createSon()" acl="Root.Admin.LMS.Organization.Create"><i nz-icon type="plus" theme="outline"></i>新增下级</button>
    <button nz-button (click)="delNode()" acl="Root.Admin.LMS.Organization.Delete"><i nz-icon type="delete" theme="outline"></i>删除</button>
    <osharp-ad-search [request]="request" [columns]="columns" (submited)="search($event)"></osharp-ad-search>
  </div>
<nz-row nzGutter="32">
  <nz-col  nzSm="8" nzXs="24">
    <nz-card [nzBordered]="false" nzTitle="组织结构层级">
      <nz-tree #tree [nzData]="treeData"   [nzExpandAll]="true" (nzClick)="treeNodeClicked()"  ></nz-tree>
    </nz-card>
  </nz-col>
  <nz-col  nzSm="16" nzXs="24">
    <nz-card [nzBordered]="false" nzTitle="用户">
      <app-uni-users #orgUsers></app-uni-users>
    </nz-card>
  </nz-col>
</nz-row>
</nz-card>

<nz-modal #modal [nzVisible]="false" [nzTitle]="editTitle" [nzClosable]="true" 
  (nzOnCancel)="cancel()" (nzOnOk)="submit()"
>
  <form nz-form [formGroup]="orgForm" (ngSubmit)="submit()">
    <nz-form-item>
      <nz-form-label nzRequired [nzSm]="6" nzFor="Id">代码</nz-form-label>
      <nz-form-control [nzSm]="14">
        <input nz-input formControlName="Id" maxlength="10" (change)="onIdChange($event)" >
      </nz-form-control>
    </nz-form-item>
    <nz-form-item>

    <nz-form-label nzRequired [nzSm]="6" nzFor="Name" >名称</nz-form-label>
    <nz-form-control [nzSm]="14">
      <input nz-input formControlName="Name" maxlength="20" >
    </nz-form-control>
    </nz-form-item>

    <nz-form-item>
      <nz-form-label [nzSm]="6" nzFor="ParentId" >路径</nz-form-label>
      <nz-form-control>
        <nz-form-text formControlName="Path" >{{Path.value}}</nz-form-text >
      </nz-form-control>
    </nz-form-item>
    
    <nz-form-item>
      <nz-form-label [nzSm]="6" nzFor="ParentId" >父节点代码</nz-form-label>
      <nz-form-control>
        <nz-form-text formControlName="ParentId" >{{ParentId.value}}</nz-form-text >
      </nz-form-control>
    </nz-form-item>

    {{orgForm.value | json }}

  </form>
</nz-modal>

